home *** CD-ROM | disk | FTP | other *** search
- property timescale : 600
- property fps : 15
- property fade_duration : 2 -- in seconds
- property display_text : (return & return & "2-Sec Background Fade" & return & "WHITE TO BLACK")
-
- tell application "QuickTime Player"
- launch
- activate
- stop every movie
- try
- -- CHECK FOR THE CORRECT VERSION
- set QT_version to (QuickTime version as string)
- set player_version to (version as string)
- if (QT_version is less than "5.0") or ¬
- (player_version is less than "5.0") then
- error "This script requires QuickTime 5.0 or greater." & ¬
- return & return & ¬
- "Current QuickTime Version: " & QT_version & return & ¬
- "Current QuickTime Player Version: " & player_version
- end if
- -- CHECK FOR QUICKTIME PRO
- if QuickTime Pro installed is false then
- set the target_URL to "http://www.apple.com/quicktime/download/"
- set the message_text to "This script requires QuickTime Pro." & return & return & ¬
- "If this computer is currently connected to the Internet, " & ¬
- "click the “Upgrade” button to visit the QuickTime Website at:" & ¬
- return & return & target_URL
- display dialog message_text buttons {"Upgrade", "Cancel"} default button 2
- ignoring application responses
- tell application "Finder"
- open location target_URL
- end tell
- end ignoring
- error number -128
- end if
- display dialog "Creating Fade Example…" buttons {"•"} default button 1 giving up after 2
- make new movie
- set position of window 1 to {144, 144}
- make new track at movie 1 with data " "
- set the frame_duration to (timescale / fps) div 1
- set the frame_count to (fade_duration * fps)
- tell movie 1
- tell track 1
- set dimensions to {240, 180}
- tell frame 1
- set the dimensions to {240, 180}
- set the default font to "Geneva"
- set the default font size to 24
- set the background color to {65535, 65535, 65535}
- set the foreground color to {0, 0, 0}
- set the duration to the frame_duration
- set justification to center
- set antialias to true
- end tell
- end tell
- set the dialog_text to ("Adding " & (frame_count - 1) as string) & " Frames." & ¬
- return & return & "This will take a moment…"
- display dialog dialog_text buttons {"•"} default button 1 giving up after 2
- set the shade_increment to (65535 / frame_count) div 1
- set the gradation_value to 65535 - shade_increment
- repeat (frame_count - 1) times
- make new frame at track 1 with data display_text
- tell the last frame of track 1
- set the background color to {gradation_value, gradation_value, gradation_value}
- set the duration to the frame_duration
- set the default font to "Geneva"
- set the default font size to 18
- set the foreground color to {65535, 65535, 65535}
- set antialias to true
- end tell
- set gradation_value to (gradation_value - shade_increment)
- if the gradation_value is less than 0 then set gradation_value to 0
- end repeat
- set the full text of annotation "Full Name" to "2-Sec Bckgnd Fade • W2B"
- end tell
- display dialog "Process Completed." buttons {"•"} default button 1 giving up after 2
- on error error_message number error_number
- if the error_number is not -128 then
- beep
- display dialog error_message buttons {"Cancel"} default button 1
- end if
- end try
- end tell